package com.raise.drive.model.service.impl;

import com.raise.drive.model.service.SearchService;
import com.raise.drive.model.search.*;
import com.raise.drive.model.domain.*;
import com.raise.drive.model.dao.*;

import java.util.List;

/**
 * @author Eugene Rozov
 */
public class SearchServiceImpl implements SearchService {

    private AnswerDao answerDao;
    private QuestionDao questionDao;
    private SectionDao sectionDao;
    private CommentDao commentDao;
    private ThemeDao themeDao;
    private UserDao userDao;


    public void setAnswerDao(AnswerDao answerDao) {
        this.answerDao = answerDao;
    }

    public void setQuestionDao(QuestionDao questionDao) {
        this.questionDao = questionDao;
    }

    public void setSectionDao(SectionDao sectionDao) {
        this.sectionDao = sectionDao;
    }

    public CommentDao getCommentDao() {
        return commentDao;
    }

    public void setCommentDao(CommentDao commentDao) {
        this.commentDao = commentDao;
    }

    public ThemeDao getThemeDao() {
        return themeDao;
    }

    public void setThemeDao(ThemeDao themeDao) {
        this.themeDao = themeDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }


    public List<Answer> getAnswers(AnswerSearchRequest searchRequest) {
        return answerDao.findAnswers(searchRequest);
    }

    public List<Question> getQuestions(QuestionSearchRequest searchRequest) {
        return questionDao.findQuestions(searchRequest);
    }

    public List<Section> getSections(SectionSearchRequest searchRequest) {
        return sectionDao.findSections(searchRequest);
    }

    public int getAnswersCount(AnswerSearchRequest searchRequest) {
        return answerDao.getAnswersCount(searchRequest);
    }

    public int getQuestionsCount(QuestionSearchRequest searchRequest) {
        return questionDao.getQuestionsCount(searchRequest);
    }

    public int getSectionsCount(SectionSearchRequest searchRequest) {
        return sectionDao.getSectionsCount(searchRequest);
    }

    public List<Theme> getThemes(ThemeSearchRequest searchRequest) {
        return themeDao.findThemes(searchRequest);
    }

    public List<User> getUsers(UserSearchRequest searchRequest) {
        return userDao.findUsers(searchRequest);
    }

    public List<Comment> getComments(CommentSearchRequest searchRequest) {
        return commentDao.findComments(searchRequest);
    }

    public int getThemesCount(ThemeSearchRequest searchRequest) {
        return themeDao.getThemesCount(searchRequest);
    }

    public int getUsersCount(UserSearchRequest searchRequest) {
        return userDao.getUsersCount(searchRequest);
    }

    public int getCommentsCount(CommentSearchRequest searchRequest) {
        return commentDao.getCommentsCount(searchRequest);
    }
}
